package org.usc.file;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.dao.HomeworkDao;
import com.opensymphony.xwork2.ActionSupport;
import com.util.HttpUtil;

public class DwAction extends ActionSupport {
	/**
	 * 
	 */
	
	private List<UploadFiles> uploadFiles;
	
	public String execute(){
		String homepath = ServletActionContext.getRequest().getParameter("homePath");//获得参数，即文件夹的名称
		HttpUtil.setSession("homepath", homepath);
		//System.out.println(ServletActionContext.getRequest().getParameter("homePath"));
		HomeworkDao dao = new HomeworkDao();
		uploadFiles = dao.getUploadFileslist(homepath);
		ServletActionContext.getRequest().setAttribute("uploadFiles",
				uploadFiles);
		return SUCCESS;
				
		
	}
	private static final long serialVersionUID = 1L;
	public List<UploadFiles> getUploadFiles() {
		return uploadFiles;
	}

	public void setUploadFiles(List<UploadFiles> uploadFiles) {
		this.uploadFiles = uploadFiles;
	}

}
